
def flat_list(arr, result=[]):
    if not isinstance(arr, list):
        return result
    for ele in arr:
        if isinstance(ele, list):
            flat_list(ele, result)
        else:
            result.append(ele)
    return result
